﻿using blackhouse.BlackApart.Business.Reservations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

namespace blackhouse.StareKino.QuartzActions.ASyncMails {
    public class LinkToAddOpinion : HyperLink {

        public IWebReservation Reservation { get; set; }
        public string CssStyle { get; set; }

        protected override void OnLoad(EventArgs e) {
            base.OnLoad(e);

            this.NavigateUrl = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/twoja-opinia?addopinion=" + this.Reservation.ReservationId + "&reservation=" + this.Reservation.Guid;
            this.Text = this.Text.ReplaceEx("{url}", HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/twoja-opinia");
            this.Attributes.Add("style", this.CssStyle);
        }

        protected override void Render(System.Web.UI.HtmlTextWriter writer) {
            base.Render(writer);
        }

    }
}